'use client'

import { useUserStore } from '@/store/user'
import { Avatar } from 'antd'
import { useRouter } from 'next/navigation'

export default function UserAvatar() {
	const { userInfo } = useUserStore()

	const router = useRouter()

	return (
		<div className="py-4 border-b border-gray-700 w-full flex justify-center">
			<Avatar
				size={48}
				src={userInfo?.avatar || '/default-avatar.png'}
				className="cursor-pointer hover:opacity-80"
				onClick={() => router.push('/im-system/personalCenter')}
			/>
		</div>
	)
}
